<!--
 * @Descripttion: 
 * @version: 
 * @Author: lsy
 * @Date: 2021-12-08 08:59:29
 * @LastEditors: lsy
 * @LastEditTime: 2021-12-16 16:19:02
-->
<template>
  <div class="home_div">
    <div class="home_header">
      <div class="logo_div">
        <img :src="logo" />
        {{ logoName }}
      </div>
      <div style="margin-right:30px;">
        <a-button type="link" @click="openPath(`https://192.168.3.201/config/#/login`)">运维中心</a-button>
        <a-button type="link" @click="openPath(`https://192.168.3.201/api/index.html`)">OpenAPI</a-button>
        <a-button type="link" @click="openPath(`https://192.168.3.201/#/helpCenter`)">帮助中心</a-button>
        <info />
        <a-button type="link">中文</a-button>
        <user />
      </div>
    </div>
    <home-menu />
  </div>
</template>

<script>
import HomeMenu from './HomeMenu.vue';
import info from './info.vue';
import user from './user/index.vue';
export default {
  name: 'Home',
  components: {
    HomeMenu, info, user
  },
  data() {
    return {
      logo: localStorage.getItem('logo'),
      logoName: localStorage.getItem('logoName')
    }
  },
  mounted() {
    VE_API.system.getloginConfig().then(res => {
      localStorage.setItem("logo", res.data.data.loginLogo)
      localStorage.setItem("logoName", res.data.data.platName)
    })
    VE_API.i18n.getLanguagezhcn().then(res => {
      this.$i18n.setLocaleMessage("zh", res.data.data);
      localStorage.setItem("language", "zh-cn")
    })
  },
  methods: {
    openPath(path) {
      window.open(path);
    }
  }
}
</script>
<style lang="scss" scoped>
.logo_div {
  display: flex;
  color: white;
  font-size: 25px;
  font-weight: bold;
  img {
    width: 40px;
    height: 40px;
    margin: 5px;
  }
}
.home_header {
  display: flex;
  justify-content: space-between;
  height: 50px;
  background: #212333;
  color: white;
  line-height: 50px;
  h2 {
    margin-left: 20px;
    color: white;
  }
  .ant-btn-link {
    color: rgb(207, 206, 206);
    &:hover {
      color: white;
    }
  }
}
</style>